package wxb.avalon.core.util;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import wxb.avalon.core.bean.Constant;

import javax.servlet.http.HttpServletRequest;

/**
 * 处理请求头工具
 */
public class RHUtil {

    public static Integer getPlayerId(HttpServletRequest request){
        if (null == request) return null;
        String id = request.getHeader(Constant.PLAYER_ID);
        if (StringUtils.isBlank(id)){
            return null;
        }
        return Integer.parseInt(id);
    }

}
